#!/usr/bin/env php
<?php

        try {

            date_default_timezone_set("Asia/Shanghai");
            $args = $argv;
            array_shift($args);
            if(!in_array('p',$args)){
                define('ENV','dev');
            }else{
                define('ENV','produce');
            }

            define('ROOT_PATH',__DIR__);
            include_once "Lib/Loader.php";
            Helper\Config::getInstance()->register();
            $ws = new Server\WebsocketServer();
            $ws->start();

        }
        catch (Error $e) {
            var_dump($e->getMessage());
        }
        catch(Exception $e) {
            var_dump($e->getMessage());
        }

?>
